<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class TbDocument extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
     */
    public function toArray($request)
    {
        $document = parent::toArray($request);
        $document['create_date'] = date('Y-m-d H:i:s', strtotime($this->create_date));
        return $document;
    }
}
